import {request} from '../request';

const requestPre = "/resource/ds";

export function pageTableData(data) {
	return request.post(
		requestPre + "/pageTableData",
		data
	);
}

export function checkDsConnection(data) {
	return request.post(
		requestPre + "/checkDsConnection",
		data,
	);
}

export function dsTypes() {
	return request.get(
		requestPre + "/dsTypes"
	);
}

export function saveDs(data) {
	return request.post(
		requestPre + "/saveDs",
		data
	);
}

export function updateDs(data) {
	return request.post(
		requestPre + "/updateDs",
		data
	);
}

export function batchDeleteDs(data) {
	return request.post(
		requestPre + "/batchDeleteDs",
		data
	);
}


export function uploadDriver(data) {
	return request.post(
		requestPre + "/uploadDriver",
		data,
		{
			headers: {"Content-Type": "multipart/form-data"}
		}
	);
}

export function downDriver(dsType) {
	return request.get(
		requestPre + `/downDriver/${dsType}`,
	);
}


export function queryJarList(dsType) {
	return request.get(
		requestPre + `/queryJarList/${dsType}`,
	);
}



